function indexData() {
    $('#example-r').DataTable({

        bInfo: false, //页脚信息
        dom: 'ti'
    });

    // ==========================
    // 百度图表A http://echarts.baidu.com/
    // ==========================

    var echartsA = echarts.init(document.getElementById('tpl-echarts'));
    option = {
        tooltip: {
            trigger: 'axis'
        },
        grid: {
            top: '3%',
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [{
            type: 'category',
            boundaryGap: false,
            data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月','八月','九月','十月','十一月','十二月']
        }],
        yAxis: [{
            type: 'value'
        }],
        textStyle: {
            color: '#838FA1'
        },
        series: [{
            name: '利润',
            type: 'line',
            stack: '收益',
            areaStyle: { normal: {} },
            data: [30000, 20000, 10000, 20000, 9000],
            itemStyle: {
                normal: {
                    color: '#1cabdb',
                    borderColor: '#1cabdb',
                    borderWidth: '2',
                    borderType: 'solid',
                    opacity: '1'
                },
                emphasis: {

                }
            }
        }]
    };

    $.ajax({
        url: "searchForMain",
        type: 'get',
        dataType: 'json',
        success:function(data){
            option.series[0].data = data.data;
        },
        error:function(e){
            console.log("获取数据失败")
        }
    })

    echartsA.setOption(option);
}

/**
 * 查找用户日志
 */
function reSelect() {
    $("input[type='checkbox']").each(function () {
        $(this).prop("checked",!$(this).prop("checked"))
    })
}

let condition = {"pageNum":1};
function searchRecord(url){
    $.ajax({
        url: "record/"+url,
        type: 'post',
        dataType: 'html',
        contentType:"application/json;charset=utf-8",
        data:JSON.stringify(condition),
        success:function(data){
            $("#content").html(data);
        },
        error:function(e){
            console.log("获取数据失败")
        }
    })
}

// 风格切换

$('.tpl-skiner-toggle').on('click', function() {
    $('.tpl-skiner').toggleClass('active');
})

$('.tpl-skiner-content-bar').find('span').on('click', function() {
    $('body').attr('class', $(this).attr('data-color'))
    saveSelectColor.Color = $(this).attr('data-color');
    // 保存选择项
    storageSave(saveSelectColor);

})

// 侧边菜单开关
$('.tpl-header-switch-button').on('click', function() {
    if ($('.left-sidebar').is('.active')) {
        if ($(window).width() > 1024) {
            $('.tpl-content-wrapper').removeClass('active');
        }
        $('.left-sidebar').removeClass('active');
    } else {

        $('.left-sidebar').addClass('active');
        if ($(window).width() > 1024) {
            $('.tpl-content-wrapper').addClass('active');
        }
    }
})

// 侧边菜单
$('.sidebar-nav-sub-title').on('click', function() {
    $(this).siblings('.sidebar-nav-sub').slideToggle(80)
        .end()
        .find('.sidebar-nav-sub-ico').toggleClass('sidebar-nav-sub-ico-rotate');
})
